home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Demos / A.D. Software / OOFILE / Buildable, limited OOFILE / source / reports / oofhtml.hpp < prev    next >
Text File  |  1996-03-24  |  2KB  |  85 lines

  1. #ifndef H_OOFHTML
  2. #define H_OOFHTML
  3. // COPYRIGHT 1994 A.D. Software, All rights reserved
  4.  
  5. // report-writer layer of OOFILE database
  6.  
  7. // NOTE inline definitions included at end of this header file
  8.  
  9. #include "oof2.hpp"
  10. #include "oofrw.hpp"
  11. #include "oofview.hpp"
  12.  
  13. class dbRepLineHTML : public dbClass {
  14.     public:
  15.         dbRepLineHTML() :
  16.             mLine(0) {};
  17.         ~dbRepLineHTML();
  18.     private:
  19.         dbRepLineHTML(const dbRepLine&) { assert(0); };
  20.         void operator=(const dbRepLine&) { assert(0); };
  21.     
  22.     public:
  23.         
  24.         void prepare();
  25.         void clear();
  26.         void drawNCharsAt(unsigned int hPos, char* theChars, unsigned int len);
  27.         void draw(unsigned int indent, ostream& os);
  28.         
  29.         char *mLine;              // owned        // for drawing onto
  30.         unsigned int mWidth;      // size of horizontal line - given to us by dbRepPage
  31.         unsigned int* mFieldPos;  // starting position of each field    // owned
  32. };
  33.  
  34. class dbRepHTML : public dbRep {
  35. public:
  36. // construction
  37.     dbRepHTML(const dbRepSizer& sizer, const dbView& fields, const ReportStyles style=columnar) :
  38.                 dbRep(sizer, fields, style),
  39.                 mLine() {};
  40.     
  41.     dbRepHTML(const dbRepSizer& sizer, const dbRepColWidths colWidths, const dbView& fields, const ReportStyles style=columnar) :
  42.                 dbRep(sizer, colWidths, fields, style),
  43.                 mLine() {};
  44.     // use default copy ctor
  45.  
  46. // presentation    
  47.     void formatForCharStream();        // may be others later
  48.     void draw(ostream&);
  49.     
  50.     bool drawWrappedCharsSingle(unsigned int hPos,unsigned int width,char **theString);
  51.     void drawColumnar(ostream&);
  52.     void drawPageWise(ostream&);
  53.     void drawHeader(ostream&);
  54.  
  55. private:
  56.     dbRepLineHTML mLine;
  57. };
  58.  
  59.  
  60. class dbRepHTMLTable : public dbRep {
  61. public:
  62. // construction
  63.     dbRepHTMLTable(const dbRepSizer& sizer, const dbView& fields, const ReportStyles style=columnar) :
  64.                 dbRep(sizer, fields, style),
  65.                 mCellWidths(0) {};
  66.     
  67.     dbRepHTMLTable(const dbRepSizer& sizer, const dbRepColWidths colWidths, const dbView& fields, const ReportStyles style=columnar) :
  68.                 dbRep(sizer, colWidths, fields, style),
  69.                 mCellWidths(0) {};
  70.     // use default copy ctor
  71.  
  72. // presentation    
  73.     void formatForCharStream();        // may be others later
  74.     void draw(ostream&);
  75.     
  76.     void drawColumnar(ostream&);
  77.     void drawPageWise(ostream&);
  78.     void drawHeader(ostream&);
  79.  
  80. private:
  81.     unsigned int* mCellWidths;
  82. };
  83.  
  84.  
  85. #endif